#include <iostream>
using namespace std;
int judge(char ch)
{
   if(ch==' '||ch==','||ch=='!'||ch=='?'||ch=='.'||ch==';'||ch==':')
	   return -1;
   else
	   return 0;
}
int main()
{
	char s[80]="";
	gets(s);
	int i=0;
	while(s[i]!='\0')
	{
		int start=i;
		int end=i;
	  while(judge(s[end])!=-1&&s[end]!='\0')
	  {
	     end++;
		 i++;
	  }
	  for(int j=end-1;j>=start;j--)
	  {
	     putchar(s[j]);
	  }
	  if(s[i]=='\0')
		  break;
	  else
	      putchar(s[i++]);
	}
	cout<<endl;
  return 0;
}
